<template>
    <div class="node_box">
        <div class="node_body" @click="alert(1)">
            {{ nodeConfig.name }}
        </div>
    </div>
</template>

<script lang="ts" setup>
let props = defineProps(['nodeConfig']); //数组|对象写法都可以

let $emit = defineEmits(['xxx','click']);

const alert = () => {
    console.log(111);
}
</script>

<style lang="scss" scoped>
.node_box {
    display: flex;
    justify-content: center;
    background: #f4f4f4;

    .node_body {
        position: relative;
        width: 150px;

        &::before {
            content: "";
            position: absolute;
            left: calc(50% - 6px);
            top: -6px;
            width: 0;
            height: 0;
            border: 6px solid #000;
            border-color: #000 transparent transparent transparent;
        }
    }
}
</style>
